package chapter06

/**
  * create by undeRdoG on  2021-06-02  11:26
  * 凡心所向，素履以往，生如逆旅，一苇以航。
  */
object Test10_AnnoymousClass {

  /**
  *   匿名子类
  * */
  def main(args: Array[String]): Unit = {
    val person = new Person10 {
      override var name: String = "alice"

      override def eat(): Unit = {
        println("person eat")
      }
    }

    person.eat
  }
}



abstract class Person10{
  var name: String
  def eat(): Unit
}